''' Mission 6 - final Solution code with 2 functions ''' from codex import * from time import sleep delay = 1 # --Function def heart_beat(): display.show(pics.HEART) sleep(delay) display.show(pics.HEART_SMALL) sleep(delay) def adjust_speed(): global delay if buttons.was_pressed(BTN_A): delay = delay + 0.2 if buttons.was_pressed(BTN_B): delay = delay - 0.2 if delay < 0.2: delay = 0.2 # --Main Program while True: heart_beat() adjust_speed() # Kill Switch if buttons.was_pressed(BTN_U): break